Skip to content

Add QUERY method support (RFC 10008)#1055

Merged
Kludex merged 7 commits into
pydantic:mainfrom
Diegorro98:implement-query-method-rfc10008
Jul 14, 2026
Merged

Add QUERY method support (RFC 10008)#1055
Kludex merged 7 commits into
pydantic:mainfrom
Diegorro98:implement-query-method-rfc10008

Conversation

@Diegorro98

@Diegorro98 Diegorro98 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the QUERY HTTP method as defined in RFC 10008 — a safe, idempotent method that carries a request body to express a query predicate.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

Review in cubic

Diegorro98 and others added 2 commits July 6, 2026 19:27
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
@codspeed-hq

codspeed-hq Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 15 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing Diegorro98:implement-query-method-rfc10008 (46a39ae) with main (509f7f3)

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 9 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/httpx2/httpx2/_client.py Outdated
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

@mbeijen mbeijen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks. I think the biggest problem is this here:

# Do what the browsers do, despite standards...
# Turn 302s into GETs.
if response.status_code == codes.FOUND and method != "HEAD":
method = "GET"

On HTTP 302 (and NOT on other "redirecty" codes) we turn requests into GET. This is done because "reasons". But QUERY is like a GET so I strongly think that the methods should be preserved here. I'd like to hear thoughts from @Kludex on this though.

Comment thread src/httpx2/httpx2/_api.py Outdated
Comment thread src/httpx2/httpx2/_client.py Outdated
@Kludex Kludex enabled auto-merge (squash) July 14, 2026 07:25
@Kludex Kludex merged commit f4aa8ae into pydantic:main Jul 14, 2026
12 checks passed
@Diegorro98 Diegorro98 deleted the implement-query-method-rfc10008 branch July 14, 2026 07:27
@Kludex

Kludex commented Jul 14, 2026

Copy link
Copy Markdown
Member

Thanks @mbeijen and @Diegorro98 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants